<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let date = new Date();
        let Year = ''+date.getFullYear();
        let Mon = date.getMonth() + 1 + '';
        let Day = ''+date.getDate();
        let week = ''+date.getDay();
        let Hour = ''+date.getHours();
        let Min = ''+date.getMinutes();
        let Sec = ''+date.getSeconds();


        // 2023-5-17 14:47:23
        let str = `${Year}-${Mon.padStart(2,0)}-${Day.padStart(2,0)} ${Hour.padStart(2,0)}:${Min.padStart(2,0)}:${Sec.padStart(2,0)}`;
        console.log(str);


        // let str = 'ok';
        // let str2 = str.padStart(20,'A');
        // console.log(str2);
        
    </script>
</body>
</html>